import { AnimationComponent } from 'cc'
import { StateMachine } from '../../Base/StateMachine'
import { State } from '../../Base/AnimationState'

export enum TRAP_STATE {
  IDLE = 'idle', //待机
  ATTACK = 'attack', //攻击
}

export class TrapStateMachine extends StateMachine<TRAP_STATE> {
  constructor(private _animationComponent: AnimationComponent) {
    super()
    this.initStateMap()
  }
  initStateMap() {
    const acp = this._animationComponent
    const idleBaseUrl = 'texture/spikes/spikesfour'
    const attackBaseUrl = 'texture/spikes/spikesfour'
    this.addState(TRAP_STATE.IDLE, new State(acp, `${idleBaseUrl}/zero`))
    this.addState(TRAP_STATE.ATTACK, new State(acp, `${attackBaseUrl}/five`))
  }
}
